<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script src="../../../resources/gesture-util.js"></script>
<body style="margin:0">
  <div id="overflowDiv" style="width:1000px; height:500px; overflow:scroll">
    <div style="height: 1000px"></div>
  </div>
  <div style="height: 1000px"></div>
</body>
<script>
  internals.settings.setScrollAnimatorEnabled(false);
  var overflowDiv = document.getElementById('overflowDiv');

  promise_test (async () => {
    overflowDiv.addEventListener("scroll", () => {
      Promise.reject('overflowDiv should not scroll.');
    });

    // Move the mouse over the vertical scrollbar.
    await mouseMoveTo(790, 300);

    // Scroll down precisely by 30 px.
    await smoothScroll(30, 790, 300, GestureSourceType.MOUSE_INPUT, 'down', SPEED_INSTANT);

    await waitFor( () => {return window.scrollY == 30});
  }, "Test that wheel scrolling over the page scrollbar scrolls " +
      "the page. We also placed an overflow div below the " +
      "scrollbar to make sure we target the page and not the div " +
      "in that case.");
</script>
